<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center editRcord_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub editRcord_fd0_0'>
          <view class='flex flex-wrap align-center editRcord_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  editRcord_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='editRcord_fd0_0_c1_c0'>库存记录</text>
          </view>
          <view class='flex flex-wrap align-center justify-end editRcord_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-center benben-flex-layout">
        <!-- <view class='flex flex-wrap align-center justify-between flex-sub editRcord_fd1_0'
          v-for="(item,index) in datalist" :key="index">
          <text>{{item.name}}</text>

          <benben-flex-number-box class-name='flex flex align-center' input-class="editRcord_numberBoxInputfd1_0_c1"
            v-model="item.num" :min="1" :step="1" :opacity="0.3">
            <template #minus>
              <image class='editRcord_fd1_0_c1_c0' mode="aspectFill" :src='STATIC_URL+"51.png"'></image>
            </template>
            <template #plus>
              <image class='editRcord_fd1_0_c1_c0' mode="aspectFill" :src='STATIC_URL+"50.png"'></image>
            </template>

          </benben-flex-number-box>

        </view> -->
        <view class='flex flex-wrap align-center justify-between flex-sub editRcord_fd1_0'>
          <text>电池</text>
          <view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_0_c1'>
            <benben-select-diy ref="showSelectPopup1689675271268" class-name='flex flex-wrap align-center flex'
              :items.sync="datalist" v-model="changeId" default-type="aid" default-label="title" :allow-cancel='false'
              type="radio" :disabled='false'>
              <template v-for='(item,key0) in datalist'>
                <view v-if="item.isSelected" class='flex align-center justify-center flex feedBack_fd1_0_c1_c0_c0'
                  :key="key0" @tap="$refs.showSelectPopup1689675271268.tapHandle(key0)">
                  <text class='flex-sub feedBack_fd1_0_c1_c0_c0_c0'>{{item.title}}</text>
                </view>
                <view v-else class='flex align-center justify-center flex feedBack_fd1_0_c1_c0_c1' :key="key0"
                  @tap="$refs.showSelectPopup1689675271268.tapHandle(key0)">
                  <text class='flex-sub feedBack_fd1_0_c1_c0_c1_c0'>{{item.title}}</text>
                </view>
              </template></benben-select-diy>
          </view>

        </view>
        <view class='flex flex-wrap align-center justify-between flex-sub editRcord_fd1_0'>
          <text>数量</text>
          <benben-input class='flex-sub creatorder_fd1_2_c2' type="number" :placeholder="`请输入`" confirm-type="done"
            placeholder-style="color:#999;font-size:28rpx" v-model="quantity" />

        </view>
        <view class="editRcord_fd1_0">
          <view>备注</view>
          <view>
            <textarea class='flex-sub creatorder_input_fd1_3' confirm-type="done" :placeholder="'请输入'" :maxlength="800"
              :show-num='true' placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx" v-model="remarks" />
          </view>
        </view>
        <button class='editRcord_fd1_2' @click="submit">提交</button>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        quantity: '',
        remarks: '',
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "datalist": [{
          "title": "增加",
          "aid": "1",

        }, {
          "title": "减少",
          "aid": "2",

        }],
        changeId: '1'
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      // this.getnp65d1d342a6a84Func()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //查询库存记录
      getnp65d1d342a6a84Func() {
        // 65d1d4061848a
        this.$api.post(global.apiUrls.post65d1d4061848a, {}).then(res => {
          if (res.data.code == 1) {
            this.datalist = res.data.data.map(item => {
              const obj = {
                name: item.name,
                aid: item.aid,
                num: 0
              }
              return obj
            })
          }
        })
        // this.minixPagingListsApi = global.apiUrls.post65d1d342a6a84;
        // this.pageingListApiMethod = 'get';
        // this.allowOnloadGetList = false;
        // this.pagingListPostDataContent = {}
        // this.listData = [];
        // this.datalist = this.listData;
        // this.pagingListToggle();
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
      changeNum(e) {
        console.log('eee', e)
      },
      submit() {
        let quantitys = ''
        if (this.changeId == 2) {
          quantitys = `-${this.quantity}`
        } else {
          quantitys = `${this.quantity}`
        }
        this.$api.post(global.apiUrls.post66b96f4d4148f, {
          quantity: quantitys,
          remarks: this.remarks
        }).then(res => {
          if (res.data.code == 1) {
            uni.navigateBack()
          } else {
            this.$message.info(res.data.msg)
          }
        })
      }
    }
  };
</script>
<style lang="scss" scoped>
  .feedBack_fd1_0_c1_c0_c1_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
    line-height: 62rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-align: center;
  }

  .feedBack_fd1_0_c1_c0_c1 {
    background: rgba(246, 247, 249, 1);
    margin: 16rpx 16rpx 16rpx 16rpx;
    height: 64rpx;
    border-radius: 44rpx;
    width: 206rpx;
    padding: 0rpx 10rpx 0rpx 10rpx;
  }

  .feedBack_fd1_0_c1_c0_c0_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: rgba(16, 51, 126, 1);
    line-height: 62rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-align: center;
  }

  .feedBack_fd1_0_c1_c0_c0 {
    border: 1px solid rgba(16, 51, 126, 1);
    background: rgba(16, 51, 126, 0.08);
    margin: 16rpx 16rpx 16rpx 16rpx;
    height: 64rpx;
    border-radius: 44rpx;
    width: 206rpx;
    padding: 0rpx 10rpx 0rpx 10rpx;
    background-size: 100% auto;
  }

  .feedBack_fd1_0_c1 {
    // border-bottom: 10px solid rgba(246, 247, 248, 1);
    padding: 0rpx 16rpx 16rpx 16rpx;
  }

  .creatorder_fd1_2_c2 {
    text-align: right;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
  }

  .creatorder_input_fd1_3 {
    width: 702rpx;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
    border-radius: 16rpx;
    background: #f8f8f8;
    margin: 24rpx auto 0 auto;
    padding: 24rpx
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .editRcord_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .editRcord_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .editRcord_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .editRcord_fd0_0_c0 {
    width: 120rpx;
  }

  .editRcord_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .editRcord_fd1_2 {
    background: var(--benbenbgColor4);
    border-radius: 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    position: fixed;
    bottom: calc(100rpx + var(--window-bottom));
    right: 32rpx;
  }

  .editRcord_fd1_0_c1_c0 {
    height: 50rpx;
    margin: 0rpx 4rpx 0rpx 4rpx;
    // transform: translateY(2rpx);
    width: 50rpx;
  }

  ::v-deep .editRcord_numberBoxInputfd1_0_c1 {
    background: #f2f3f5;
    width: 80rpx;
    height: 50rpx;
    text-align: center;
    color: #323232;
    font-size: 28rpx;
  }

  .editRcord_fd1_0 {
    border-bottom: 1px solid #eee;
    width: 710rpx;
    padding: 24rpx;
  }
</style>
